<%
QString lang = httpRequest().cookie("lang");
QVariant tid = tId();
QVariantMap qMapOut;
qMapOut.insert("tid",tid);
%>
<!-- searchFrom -->
<fieldset id="searchFieldsetMenu<%== tid %>" class="hideFieldset"> <!--    default hide-->
<legend><label>
<input type="checkbox" onclick="toggleSearch(this, 'searchFieldsetMenu<%== tid %>')" hidefocus=""/><%== UI("Search Criteria") %>
</label></legend>
<div class="fieldset-body">
    <%== renderPartial("SystemUIsetting/formSearchMenu",qMapOut) %>
 </div>
</fieldset>
<!-- toolBar -->
 <div class="mini-toolbar" style="border:0px">
        <a class="mini-button" onclick="doSearch('searchFormMenu<%== tid %>','gridMenu<%== tid %>')"><%== UI("Search") %></a>
        <a class="mini-button" onclick="showRecord('gridMenu<%== tid %>','<%== UI("Menu") %>',650,500,'/PartialService/formMenu?action=show',['menuId'])" tooltip="" ><%== UI("Show Details") %></a>
 </div>
<!-- grid -->
<div class="mini-fit">
<div id="gridMenu<%== tid %>" name="gridMenu" class="mini-datagrid" url="/DataService/Search/Menu?searchMode=page" allowSortColumn="false" 
   style="height:100%" showEmptyText="true" multiSelect="true" onpreload="onpreload" >
  <div property="columns">
   <div type="indexcolumn" width="25"></div>
   <div type="checkcolumn" width="25"></div>
   <div field="menuId" visible="false"><%== UI("MENUID") %></div>
   <div field="menuCd" allowsort="true"><%== UI("MENUCD") %></div>
   <div field="<%== lang=="zh"?"menuNameZh":"menuNameEn" %>" allowsort="true"><%== lang=="zh"?UI("MENUNAMEZH"):UI("MENUNAMEEN") %></div>
   <div field="menuTooltip" allowsort="true" width="500"><%== UI("MENUTOOLTIP") %></div>
   <div field="menuDesc" allowsort="true" width="100%"><%== UI("MENUDESC") %></div>
  </div>
</div>
</div>
<script type="text/javascript">
    mini.parse();
    var grid = mini.get("gridMenu<%== tid %>");
    var sorter = new MultiSort(grid);
    sorter.sort([{'field':'menuCd'}]);
    
    grid.on("drawcell", function (e) {
        if (e.field=="menuCd") {
            e.cellHtml = '<a href="javascript:showRecord(\'gridMenu<%== tid %>\',\'<%== UI("Menu") %>\',650,500,\'/PartialService/formMenu?action=show\',[\'menuId\'])">' + e.value + '</a>';
        }
    });
</script>